package cn.jbolt.ndemo.controller;

import cn.jbolt.ndemo.entity.CustomerRecord;
import cn.jbolt.ndemo.service.CustomerRecordService;
import cn.jbolt.util.Result;
import io.milvus.param.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@ResponseBody
@RequestMapping("/customerRecord")
@Tag(name = "客户投诉智能分类推送管理Controller")
public class CustomerRecordController {

    @Autowired
    private CustomerRecordService customerRecordService;

    @Operation(summary = "获取重要程度下拉选")
    @GetMapping("/getCustomerRecordLevelList")
    public Result getCustomerRecordLevelList() {
        return customerRecordService.getCustomerRecordLevelList();
    }
    @Operation(summary = "获取跟进类型下拉选")
    @GetMapping("/getCustomerRecordTypeList")
    public Result getCustomerRecordTypeList() {
        return customerRecordService.getCustomerRecordTypeList();
    }

    @Operation(summary = "获取客户跟进列表")
    @GetMapping("/list")
    public Result list(@RequestParam(required = false) String keywords) {
        return customerRecordService.getList(keywords);
    }

    @Operation(summary = "添加客户跟进记录")
    @PostMapping("/add")
    public Result add(@RequestBody CustomerRecord customerRecord) {
        return customerRecordService.add(customerRecord);
    }
    @Operation(summary = "删除客户跟进记录")
    @GetMapping("/delete/{id}")
    public Result delete(@PathVariable Long id) {
        return customerRecordService.delete(id);
    }
}
